<?php

/**
 * Erra_Fields_Date - Date field
 *
 * @package
 * @author Alexis Eric
 * @copyright Copyright (c) 2012 - Erra Prod
 * @version $1.0$
 * @access public
 */
class Erra_Fields_Date extends Erra_Fields_Base_Field {

    function __construct($objectId) {
        parent::__construct($objectId);
    }

    /**
     * Erra_Fields_Date::editInstance() - Shows input with date data and pops a calendar on click
     *
     * @param mixed $lang
     * @return
     */
    public function editInstance(Array $extraProperties = null) {
        $extraProperties['class'] = isset($extraProperties['class']) ? $extraProperties['class'] . ' jq_datepicker' : ' jq_datepicker';

        $res = '<div class="erra-form-field-instance">';
        $res .= $this->outputFieldHeader();
        $res .= '<input  type="text"  name="' . $this->getHtmlName() . '" id="' . $this->getHtmlId() . '" value="' . $this->value . '" ' . $this->getHtmlAttributes($extraProperties) . ' />';
        $res .= '</div>';
        return $res;
    }

}

?>